package zoo;

import java.awt.geom.Area;

public class MammalianZone extends Zone{
    //亚纲包含原哺乳亚纲和兽亚纲
    private String Subclass;
    //区域信息
    private ZoneArea Area;
    public MammalianZone(){}
    public MammalianZone(String subclass){
        this.Subclass=subclass;
    }


    public String getSubclass() {
        return Subclass;
    }

    public void setSubclass(String subclass) {
        Subclass = subclass;
    }
    public ZoneArea getArea() {
        return Area;
    }

    public void setArea(ZoneArea area) {
        this.Area = area;
    }
    @Override
    public boolean addAnimal(Animal animal){
    //该区域只有哺乳动物
    if(AnimalList.size()>0) {
        if (animal.getType() != AnimalList.get(0).getType()) {
            System.out.println("该动物"+animal.getAnimalname()+"不属于哺乳园区");
            return false;
        }
    }
        return this.AnimalList.add(animal);
    }
    @Override
    public void ShowAllAnimal() {
        System.out.println("该区域面积:"+ Area.getArea()+
                " 方位:"+Area.getAzimuth()+
                "\n内有:");
        for( Animal animal : AnimalList ){
            System.out.println("姓名:"+animal.getAnimalname()+
                    " 调温方式:"+animal.getTemperature()+
                    " 繁殖方式:"+animal.getReproductive_methods()+
                    " 亚纲:"+Subclass);
        }
    }




}
